/* -----------------------------------------------------------------------
 * Becky Kluth
 * CS 362
 * Assignment 3: cardtest1.c to test smithy card (refactored)
 *
 * cardtest1: cardtest1.c dominion.o rngs.o
 *      gcc -o cardtest1 -g  cardtest1.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

//set NOISY_TEST to 0 to remove printfs from output (this macro taken from the example)
#define NOISY_TEST 0

int main() {
    int seed = 1000;										//initiate a two player game
    int numPlayer = 2;
    int k[10] = {adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};
    struct gameState G;
	int startingHandCount;
	int noCrash;

    initializeGame(numPlayer, k, seed, &G);

	printf("Testing card: smithy\n");
	startingHandCount = G.handCount[0];						//get player 0 hand count
#if (NOISY_TEST == 1)
     printf("Test player 0 starts with %d cards in hand.\n", startingHandCount);
#endif
	noCrash = cardEffect(smithy, 0, 0, 0, &G, 1, 0);		//play smithy card, should add 3 cards then discard 1 card for total count change of +2 cards
	assert(noCrash == 0);
	assert(G.handCount[0] == startingHandCount + 2);		//check against starting hand count

#if (NOISY_TEST == 1)
     printf("Test player 0 ends with %d cards in hand.\n", G.handCount[0]);
#endif

    printf("All tests passed!\n");

    return 0;
}
